package design.strategy;

/**
 * 计算应付金额，针对不同的VIP会员使用不同的优惠策略
 *
 * @Author: zhenzhong.wang
 * @Time: 2018/4/10 15:35
 */
public class MoneyCalculation {

  double money = 100;

  VipStrategy strategy;

  public MoneyCalculation(VipStrategy strategy) {
    this.strategy = strategy;
  }

  public void getResult() {
    money = money * strategy.discount();
    System.out.println("应付金额：" + money);
  }

}
